﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="VendorRegister.aspx.cs" Inherits="RBOSS.WebUI.VendorRegister" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <style type="text/css">
        .auto-style1 {
            width: 115px;
        }
        .auto-style2 {
            width: 128px;
        }
    </style>
    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="center_title_bar" style="margin-bottom:10px;">Add/Update Vendor</div>
    <p class="text-danger">
                            <asp:Literal runat="server" ID="FailureText" />
                        </p>
       <br />
    <table>
        
        <tr>
            <td class="auto-style2"></td>
            <td></td>
            <td></td>
         <td class="auto-style1"> <a href="Adminhome.aspx" class="prod_details">Back</a></td>
            </tr>
         <tr>
            <td class="auto-style2">Role: </td>
            <td> <asp:DropDownList ID="RolesList1" runat="server"  Height="30px" Width="253px" CssClass="contact_input" AutoPostBack="True"></asp:DropDownList></td>
        </tr>
        <tr>
            <td class="auto-style2">User Email : </td>
            <td> <asp:TextBox ID="txtUserEmail" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="User Name is Required!" 
             ControlToValidate="txtUserEmail" ForeColor="Red" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="regexEmailValid" 
                runat="server" ForeColor="Red"
                ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                ControlToValidate="txtUserEmail" 
                ErrorMessage="Invalid Email Format" ValidationGroup="VendorValidation"></asp:RegularExpressionValidator>
                </td>
        </tr>
        <tr>
            <td class="auto-style2">Password : </td>
            <td> <asp:TextBox ID="txtPassword" runat="server" CssClass="contact_input" TextMode="Password"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Password is Required!" ForeColor="Red"
             ControlToValidate="txtPassword" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr><td class="auto-style2">Confirm</td><td><asp:TextBox ID="txbConfirm" TextMode="Password" runat="server" CssClass="contact_input" ></asp:TextBox></td>
            <td><asp:CompareValidator ID="confirmComapre" ValidationGroup="VendorValidation" runat="server" ControlToValidate="txbConfirm" ControlToCompare="txtPassword" ErrorMessage="Password missmatch" ForeColor="Red"></asp:CompareValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">First Name : </td>
            <td> <asp:TextBox ID="txtFirstName" runat="server" CssClass="contact_input" ></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="First Name is Required!" ForeColor="Red"
             ControlToValidate="txtFirstName" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">Last Name : </td>
            <td> <asp:TextBox ID="txtLastName" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Last Name is Required!" ForeColor="Red"
             ControlToValidate="txtLastName" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">Phone : </td>
            <td> <asp:TextBox ID="txtPhone" runat="server" CssClass="contact_input"></asp:TextBox><br /><span style="color:GrayText; font-size:small">ex: 641-123-2314</span></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Phone is Required!" ForeColor="Red"
             ControlToValidate="txtPhone" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ErrorMessage="Must be 10 ditits" ForeColor="Red" ControlToValidate="txtPhone"
                ValidationExpression="^[0-9]{3}-[0-9]{3}-[0-9]{4}$" ValidationGroup="VendorValidation"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="auto-style2">City : </td>
            <td> <asp:TextBox ID="txtCity" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="City is Required!" ForeColor="Red"
             ControlToValidate="txtCity" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">State: </td>
            <td> <asp:TextBox ID="txtProvience" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="State is Required!" ForeColor="Red"
             ControlToValidate="txtProvience" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">Country : </td>
            <td> <asp:TextBox ID="txtCountry" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Country is Required!" ForeColor="Red"
             ControlToValidate="txtCountry" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">Postal Code : </td>
            <td> <asp:TextBox ID="txtPostalCode" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Postal Code is Required!" ForeColor="Red"
             ControlToValidate="txtPostalCode" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
          <%if (RolesList1.SelectedItem.Text == "Vendor")
            { %>
          <tr>
            <td class="auto-style2">Account Number: </td>
            <td> <asp:TextBox ID="txtAccountNumber" runat="server" CssClass="contact_input"></asp:TextBox></td>
           <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Account Number is Required!" ForeColor="Red"
             ControlToValidate="txtAccountNumber" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">Account Type: </td>
            <td> <asp:TextBox ID="txtAccountType" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Account Type is Required!" ForeColor="Red"
             ControlToValidate="txtAccountType" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">Bank Name : </td>
            <td> <asp:TextBox ID="txtBankName" runat="server" CssClass="contact_input"></asp:TextBox></td>
            <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Bank Name is Required!" ForeColor="Red"
             ControlToValidate="txtBankName" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="auto-style2">Bank Branch : </td>
            <td> <asp:TextBox ID="txtBankBranch" runat="server" CssClass="contact_input"></asp:TextBox></td>
             <td><asp:RequiredFieldValidator runat="server" 
             ErrorMessage="Bank Branch is Required!" ForeColor="Red"
             ControlToValidate="txtBankBranch" ValidationGroup="VendorValidation">
            </asp:RequiredFieldValidator></td>
        </tr>
        <%} %>
        <tr>
            <td></td>
            <td class="auto-style2">
                <asp:Button ID = "btnRegister" runat="server" Text="Register" CssClass="bigGreenButton" OnClick="btnRegister_Click" ValidationGroup="VendorValidation"/>
            </td>
            <td></td>
            
        </tr>
    </table>
</asp:Content>
